<template>
  <div class="card">
    <img src="~assets/images/string.svg" alt="" />
    <div class="card-info">
      <h2>任务名称：{{missionName}}</h2>
      <p>加密类型</p>
      <div class="progress"></div>
    </div>
    <div class="percentage">
      <h2>100%</h2>
      <img src="~assets/images/download.svg" @click="downLoadMissionFile" alt="" />
    </div>

  </div>
</template>

<script>
import config from "@/util/config";

export default {
  name: "Card",
  props: ['missionName', 'fileName'],
  methods: {
    downLoadMissionFile(){
      let url = config.serverIp+'downLoadMissionFile?fileLocation='+this.fileName;
      window.open(url);
    }
  }
}
</script>

<style scoped>

.card {
  display: flex;
  background: linear-gradient(
      to left top,
      rgba(255, 255, 255, 0.8),
      rgba(255, 255, 255, 0.5)
  );
  border-radius: 1rem;
  margin: 0.5rem 0rem;
  padding: 0.5rem;
  box-shadow: 6px 6px 20px rgba(122, 122, 122, 0.212);
  justify-content: space-between;
  width: 550px;
}
.card img{
  flex: 1;
  height: 3.5rem;
  margin-left: 2rem;
}
.card-info {
  flex: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  margin: 0 4rem 0 5rem;
}

.percentage h2{
  font-weight: bold;
  background: linear-gradient(to right top, #65dfc9, #6cdbeb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.percentage img{
  margin: 10px 0 0 0;
  height: 30px;
  cursor: pointer;
}

.progress {
  background: linear-gradient(to right top, #65dfc9, #6cdbeb);
  width: 100%;
  height: 25%;
  border-radius: 1rem;
  position: relative;
  overflow: hidden;
}
.progress:after {
  content: "";
  width: 100%;
  height: 100%;
  background: rgb(236, 236, 236);
  position: absolute;
  left: 100%;
}
</style>